{extend name="manager@common/base"}
{block name="page-content-main"}
<form id="my-form" class="am-form tpl-form-line-form" method="post">
    <div class="widget-body">
        <fieldset>
            <div class="widget-head am-cf">
                <div class="widget-title am-fl">基本信息</div>
            </div>
            <div class="am-form-group">
                <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">公众号原始ID</label>
                <div class="am-u-sm-9 am-u-end">
                    {if condition="$need_code"}
                    <input type="text" class="tpl-form-input" name="resource[gh_id]" value="{$resource.gh_id}"
                           required/>
                    {else /}
                    <input type="text" class="tpl-form-input" name="resource[gh_id]" readonly value="{$resource.gh_id}" required/>
                    {/if}
                </div>
            </div>
            <div class="goods-spec-single">
                <div class="am-form-group">
                    <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">公众号名</label>
                    <div class="am-u-sm-9 am-u-end">
                        <input type="text" class="tpl-form-input" name="resource[title]" value="{$resource.title}"/>
                    </div>
                </div>
            </div>
            <div class="goods-spec-single">
                <div class="am-form-group">
                    <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">App id</label>
                    <div class="am-u-sm-9 am-u-end">
                        <input type="text" class="tpl-form-input" name="resource[app_id]" value="{$resource.app_id}"/>
                    </div>
                </div>
            </div>
            <div class="goods-spec-single">
                <div class="am-form-group">
                    <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">App secret</label>
                    <div class="am-u-sm-9 am-u-end">
                        <input type="password" class="tpl-form-input" name="resource[secret]" value="{$resource.secret}"/>
                    </div>
                </div>
            </div>
            <div class="goods-spec-single">
                <div class="am-form-group">
                    <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">请求令牌</label>
                    <div class="am-u-sm-9 am-u-end">
                        <input type="password" class="tpl-form-input" name="resource[token]" value="{$resource.token}"/>
                    </div>
                </div>
            </div>
            <div class="goods-spec-single">
                <div class="am-form-group">
                    <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">加密密钥</label>
                    <div class="am-u-sm-9 am-u-end">
                        <input type="password" class="tpl-form-input" name="resource[encrypt_key]" value="{$resource.encrypt_key}"/>
                    </div>
                </div>
            </div>
            <div class="goods-spec-single">
                <div class="am-form-group">
                    <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">类型</label>
                    <div class="am-u-sm-9 am-u-end">
                        {volist name="valid_types" id="item"}
                        <input type="radio"  name="resource[type}" value="{$key}" {if condition="$resource->getData('type') eq $key"}checked{/if} />{$item}
                        {/volist}
                    </div>
                </div>
            </div>
            <div class="am-form-group">
                <div class="am-u-sm-9 am-u-sm-push-3 am-margin-top-lg">
                    <button type="submit" class="j-submit am-btn am-btn-secondary">提交</button>
                </div>
            </div>
        </fieldset>
    </div>
</form>
{/block}
{block name="js-run"}
<script>
  $(function () {
    $('#my-form').superFrameForm();
  });
</script>
{/block}
